import axios from '../axios';
/**
 * 财务分析请求服务器接口
 * @interface common/api/financial
 * @author zah
 */
export default {
  /**
   * @param  {Object} data - 财务分析基础数据入参
   * @example 参数 { storeCode: ['1234'], groupCode: '1234', timeFlag: 1-日/2-周/3-月/4-年, beginTime: "1505727279573", endTime: "1505727279573"}
   * @returns {Object} 接口返回成功或者失败
   */
  getFinCount (data) {
    return axios.postWithSCode('api/report/account/analysis/statistics', data);
  },
  /**
   * @param  {Object} data - 财务分析收入支出列表入参
   * @example 参数 { storeCode: ['1234'], groupCode: '1234', timeFlag: 1-日/2-周/3-月/4-年, beginTime: "1505727279573", endTime: "1505727279573"}
   * @returns {Object} 接口返回成功或者失败
   */
  getFinList (data) {
    return axios.postWithSCode('api/report/account/analysis/list', data);
  },
  /**
   * @param  {Object} data - 收支和利润趋势入参
   * @example 参数 { storeCode: ['1234'], groupCode: '1234', timeFlag: 1-日/2-周/3-月/4-年, beginTime: "1505727279573", endTime: "1505727279573"}
   * @returns {Object} 接口返回成功或者失败
   */
  getProfitTrend (data) {
    return axios.postWithSCode('api/report/account/analysis/trend', data);
  },
  /**
   * @param  {Object} data - 年 折线图入参
   * @example 参数 { storeCode: ['1234'], groupCode: '1234', timeFlag: 1-日/2-周/3-月/4-年, beginTime: "1505727279573", endTime: "1505727279573"}
   * @returns {Object} 接口返回成功或者失败
   */
  getFinLine (data) {
    return axios.postWithSCode('api/report/account/analysis/line', data);
  }
};
